package com.aisino.nmg.operator;

import com.aisino.nmg.ant.task.GeneratorToolTask;
import com.aisino.nmg.task.GeneratorDaoCodeTask;
import com.aisino.nmg.task.GeneratorServiceCodeTask;

public class GeneratorProjectCodeOperation {
	private GeneratorToolTask task;

	public GeneratorProjectCodeOperation(GeneratorToolTask task){
		this.task = task;
	}

	public void run(){
		task.cleanGeneratorTask();
		task.addGeneratorTask(task.getEnvironmentTask());
		GeneratorDaoCodeTask daoCodeTask = new GeneratorDaoCodeTask(task);
		task.addGeneratorTask(daoCodeTask);
		GeneratorServiceCodeTask serviceCodeTask = new GeneratorServiceCodeTask(task);
		task.addGeneratorTask(serviceCodeTask);
		task.execute();
	}
}
